package com.earthchen.demo.service;

import com.baomidou.mybatisplus.service.IService;
import com.earthchen.demo.domain.SysResource;

import java.util.List;

/**
 * @author earthchen
 * @date 2018/9/4
 **/
public interface SysResourceService extends IService<SysResource> {

    /**
     * 获取角色(roleId)所被授权的API资源
     *
     * @param roleId
     * @return
     */
    List<SysResource> getAuthorityApisByRoleId(long roleId);

    /**
     * 获取角色(roleId)所被授权的menu资源
     *
     * @param roleId
     * @return
     */
    List<SysResource> getAuthorityMenusByRoleId(long roleId);

    /**
     * 获取用户被授权菜单
     *
     * @param uid
     * @return
     */
    List<SysResource> getAuthorityMenusByUserId(Long uid);

    /**
     * 获取全部菜单列
     *
     * @return
     */
    List<SysResource> getMenus();

    /**
     * 根据菜单ID删除菜单
     *
     * @param menuId
     * @return
     */
    Boolean deleteMenuByMenuId(Long menuId);

    /**
     * 获取api分类
     *
     * @return
     */
    List<SysResource> getApiTeamList();

    /**
     * 获取全部api
     *
     * @return
     */
    List<SysResource> getApiList();

    /**
     * 查询teamId 对应分类下的apis
     *
     * @param teamId
     * @return
     */
    List<SysResource> getApiListByTeamId(Long teamId);
}
